package sk.stuba.fiit.clientApp.singeltons;

import org.springframework.context.ApplicationContext;
import sk.stuba.fiit.clientApp.controller.SignatureController;

public class ControllerLocatorSingelton {

	private static ControllerLocatorSingelton controllerLocator = null;
	private static ApplicationContext applicationContext;
	
	private static final String SIGNATURE_CONTROLLER_BEAN = "signatureController";

	private ControllerLocatorSingelton() {
	}

	public static synchronized ControllerLocatorSingelton getInstance() {
		if (controllerLocator == null) {
			controllerLocator = new ControllerLocatorSingelton();
			applicationContext = ApplicationContextSingelton.getInstance();
		}
		return controllerLocator;
	}
	
	public SignatureController getSignatureContreoller(){
		return (SignatureController) applicationContext.getBean(SIGNATURE_CONTROLLER_BEAN);
	}
	

}
